package hrm.serviceimple;

import hrm.dao.LicenceDAO;
import hrm.daoimple.LicenceDAOImple;
import hrm.dto.insa.LicenceDTO;
import hrm.service.LicenceService;

import java.util.List;

public class LicenceServiceImple implements LicenceService{
	private LicenceDAO licenceDAO;
	private static LicenceServiceImple licenceService;
	
	private LicenceServiceImple(){
		licenceDAO=new LicenceDAOImple();
	}
	
	public static LicenceServiceImple getInstance(){
		if (licenceService==null) {
			licenceService=new LicenceServiceImple();
		}
		return licenceService;
	}

	public void setLicenceDAO(LicenceDAO licenceDAO) {
		this.licenceDAO = licenceDAO;
	}

	public boolean insertLicence(LicenceDTO command){
		return licenceDAO.insertLicence(command); 
	}
	
	public List getAllLicence(LicenceDTO dto){
		return licenceDAO.getAllLicence(dto);		
	}	

	@Override
	public void updateLicence(LicenceDTO command) {
		licenceDAO.updateLicence(command);		
	}

	@Override
	public void deleteLicence(LicenceDTO command) {
		licenceDAO.deleteLicence(command);		
	}
	
}
